<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/system/tags" prefix="system"%>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<%-- 权限判断 --%>
<shield:permssion type="button">
<form action="${ctxPathA}/system/permission/addOrUpdate" method="post" class="show-info">
	<shield:token/>
    <input id="id" name="id" type="hidden" maxlength="100" value="${model.id }">
    <table class="tab-show">
    	<colgroup>
    		<col width="20%">
    		<col width="">
    	</colgroup>
        <tr>
	    	<th>
            	<label><font color="red">*</font>父级编号：</label>
        	</th>
         	<td><input type="text" name="parentId" value="${model.parentId}" readonly="readonly"></td>
		</tr>
        <tr>
	    	<th>
            	<label><font color="red">*</font>权限名称：</label>
        	</th>
         	<td><input type="text" name="name" value="${model.name}"></td>
		</tr>
        <tr>
	    	<th>
            	<label><font color="red">*</font>链接：</label>
        	</th>
         	<td title="链接">
         		内置变量：
         		<input type="button" value="项目地址" ev="\${ctxPath}" class="button innerArg">
         		<input type="button" value="后台地址" ev="\${ctxPathA}" class="button innerArg">
         		<input type="button" value="前台地址" ev="\${ctxPathF}" class="button innerArg">
         		<input type="button" value="id" ev="\${id}" class="button innerArg">
         		<%-- <input class="mt5" type="text" name="href" id="nemu_href" value="${model.href}"> --%>
         		<!-- autocompleteTips提示，data-event表示点击时触发，data-tips-url为调取地址 -->
         		<input type="text" name="href" value="${model.href}" class="autocompleteTips mt5" id="nemu_href"
         	 		data-tips-url="${ctxPathA}/system/menu/getUrls" placeholder="可输入关键字后根据提示选择">
         	</td>
		</tr>
       	<tr>
	    	<th>
            	<label><font color="red">*</font>页面id（权限标识）：</label>
        	</th>
         	<td><input type="text" name="pageId" value="${model.pageId}"></td>
		</tr>
        <tr>
	    	<th>
            	<label>页面class：</label>
        	</th>
         	<td><input type="text" name="pageClass" value="${model.pageClass}"></td>
		</tr>
        <tr>
	    	<th>
            	<label>目标：</label>
        	</th>
         	<td>
         		<select name="target" data-v="${model.target}">
					<option value="">默认</option>
					<option value="iframe">iframe</option>
					<option value="dialog">弹出窗</option>
					<option value="_blank">新页面</option>
				</select>
         	</td>
		</tr>
        <tr>
	    	<th>
            	<label>图标：</label>
        	</th>
         	<td><!-- autocompleteTips提示，data-event表示点击时触发，data-tips-url为调取地址 -->
         	<input type="text" name="icon" value="${model.icon}" class="autocompleteTips" id="getMenuIcons" data-event="click"
         	 data-tips-url="${ctxPathA}/system/menu/geticons" placeholder="请点击选择"></td>
		</tr>
        <tr>
	    	<th>
            	<label>颜色：</label>
        	</th>
         	<td><input type="text" name="color" value="${model.color}"></td>
		</tr>
		<tr>
	    	<th>
            	<label>权限类型：</label>
        	</th>
         	<td>
         		<select name="permType" data-v="${empty model.permType?'1':model.permType}">
					<option value="0">无需权限</option>
					<option value="1">需要权限</option>
					<option value="2">登录权限（即需要登录）</option>
				</select>
         	</td>
		</tr>
        <tr>
	    	<th>
            	<label><font color="red">*</font>是否显示：</label>
        	</th>
         	<td>
         		<input class="radio" type="radio" value="1" name="isShow" ${model.isShow !=0 ? "checked":""}/>显示
         		<input class="radio" type="radio" value="0" name="isShow" ${model.isShow ==0 ? "checked":""}/>隐藏
         	</td>
		</tr>
        <tr>
	    	<th>
            	<label>状态：</label>
        	</th>
         	<td><c:if test="${model.state == 0 }">正常</c:if>
			<c:if test="${model.state == -1 }">删除</c:if>
			<c:if test="${model.state == 2 }">停用</c:if>
			<c:if test="${model.state == 3 }">冻结</c:if>
         	</td>
		</tr>
        <tr>
	    	<th>
            	<label>备注信息：</label>
        	</th>
         	<td>
         		<textarea name="remarks" rows="3" style="width: 100%;">${model.remarks}</textarea>
         	</td>
		</tr>
    </table>
    <div class="taCenter">
		<input class="button" type="submit" value="提交"/>
    	<input class="button default" type="reset" value="重置"/>
    </div>
</form>
</shield:permssion>
    <script type="text/javascript">
    $("input.innerArg").click(function(){
		var $this = $(this);
		var value = $this.attr("ev");
		//alert(value);
		//alert($("#scoreExpression").selection().text);
		$("#nemu_href").insertAtCursor(value);
		//alert($("#scoreExpression").val());
	});
    </script>